clear;
clc;

%% Preset Parameters
% Benchmark Parameters
StdVec          =   [1 1 1 -1 -1 60 -10]'*0.01/4;
Param_Benchmark =   struct('KAPPA',0.00/4,'XI',1/82.5/4,'Pir_SS',0.02/4,...
                            'Flag_dE',1,'Flag_Price',0,...
                            'B_Total_SS',0.91,'b_lb',-0.29,...
                            'TrProb_H',0.99,'Prob_H',0.37,...
                            'TrProb_ext',0.99,'Prob_ext',0.33,...
                            'Fin_DomShare',0.79,'Fin_AdjCost',4.75,...
                            'Cons_FracH',0.60,...
                            'RHO_M_dom',0.68,'RHO_M_ext',0.81,'RHO_Y_H',0.95,'RHO_p_F',0.90,...
                            'Taylor_Pi',1.1,'Taylor_ir',0.87,...
                            'Cons_ElasTN',6.19,'Cons_ElasHF',6.19);


%% Generate Different Results
fprintf(['Solving the model w/o Foreign Currency Denomination: \n']);
% Low
TempParam       =   Param_Benchmark;
TempParam.Flag_dE=  0;
    
SOLUTION_B_Low  =   Solver_Main(Setup_PP(TempParam),StdVec);

% High
TempParam       =   Param_Benchmark;
TempParam.Flag_dE=  0;
TempParam.Fin_DomShare ...
                =   1-(1-Param_Benchmark.Fin_DomShare)*2;

SOLUTION_B_High =   Solver_Main(Setup_PP(TempParam),StdVec);


fprintf(['Solving the model w/ Foreign Currency Denomination: \n']);
% Low
TempParam       =   Param_Benchmark;
TempParam.Flag_dE=  1;
    
SOLUTION_F_Low  =   Solver_Main(Setup_PP(TempParam),StdVec);

% High
TempParam       =   Param_Benchmark;
TempParam.Flag_dE=  1;
TempParam.Fin_DomShare ...
                =   1-(1-Param_Benchmark.Fin_DomShare)*2;

SOLUTION_F_High =   Solver_Main(Setup_PP(TempParam),StdVec);


save('Results_HighVsLowForeignShares.mat',...
     'SOLUTION_B_Low','SOLUTION_B_High',...
     'SOLUTION_F_Low','SOLUTION_F_High','-v7.3');

